package com.project.zsxd.server.notice.controller;


import com.alibaba.fastjson.JSONObject;
import com.project.zsxd.server.annotation.LoginPass;
import com.project.zsxd.server.common.bean.Result;
import com.project.zsxd.server.notice.entity.Notice;
import com.project.zsxd.server.notice.service.INoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 公告表 前端控制器
 * </p>
 *
 * @author kaler
 * @since 2021-07-07
 */
@RestController
@RequestMapping("/notice")
public class NoticeController {

    @Autowired
    private INoticeService noticeService;

    @LoginPass
    @PostMapping("queryLastNoticeByType")
    public Result queryLastNoticeByType(@RequestBody JSONObject param) {
        Notice notice = noticeService.queryLastNoticeByType(param.getString("noticeType"));
        return Result.success(notice);
    }

}
